#pragma once
#include <ncursesw/curses.h>
#include "../Headers/types.h"

namespace TOB {
  typedef struct Color {
    enum Enum {
      Default,
      SelectedMenu,
      ActiveButton,
      InactiveButton,
      Title,
      Red,
      Green,
      Blue,
      Magenta,
      Cyan,
      Yellow,
      White,
      Link,
    };
    typedef enum Enum Type;
  } Color;
  
  class UIWindow {
   public:
    UIWindow(uint16 x, uint16 y, uint16 w, uint16 h);
    ~UIWindow();

    static void init();
    static void end();
    void dispose();

    void putString(String &in);
    void putChar(Char in);
    Char getChar();

    void setCursor(uint16 x, uint16 y);
    void getCursor(uint16 &x, uint16 &y);
    static void showCursor(bool ena);

    void setColor(Color::Type color);

    void clearLine();
    void clear();

   protected:
    uint16 posx, posy, width, height;

   private:
    WINDOW *window;
    void createWindow();
  };
}
